package com.lftea.dao.impl;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.lftea.dao.ILoginDAO;

@Repository("loginDAOImpl")
public class LoginDAOImpl implements ILoginDAO {

	@Resource(name = "jdbcTemplate")
	private JdbcTemplate jdbcTemplate;

	@Override
	public boolean checkLogin(String username, String password) {
		String sql = "select count(*) from Employee where Name=? and Password=?";
		int result = jdbcTemplate.queryForInt(sql, new Object[] { username,
				password });
		return result > 0 ? true : false;
	}

}
